import request, { get, post, remove, put} from "@/utils/request"

export const loginApi = async (data: {username: string, password: string}) => await post('/login', data)
export const logoutApi = async () => await get('/logout')
export const registApi = async (data: {username: string, name: string, password: string}) => await post('/regist', data)

export const appApi = {
  list: async () => await get('app/list'),
  create: async (data) => await post('app/create', data),
  update: async (data) => await put('app/update', data),
  detail: async (name: string) => await get('app/detail', { name }),
  remove: async (name: string) => await remove('app/remove', { name }),
  preview: async () => await get('app/preview')
}